package com.example.pt.config;

import com.example.pt.service.TorrentMonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MonitorTaskScheduler {

    @Autowired
    private TorrentMonitorService torrentMonitorService;

    /**
     * 每天凌晨2点执行流量监测任务
     */
    @Scheduled(cron = "0 52 22 * * *")
    public void executeDailyMonitoring() {
        torrentMonitorService.executeDailyMonitoring();
    }
}